<!--
*Author：COCO
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/custom/custom/Base_WorkShop.js此处编写
 -->
<template>
	<view-grid ref="grid" :columns="columns" :detail="detail" v-model:editFormFields="editFormFields"
		:editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
		:table="table" :extend="extend">
	</view-grid>
</template>
<script>
import extend from "@/extension/mass/Mass_DetectionItems.js";
import { ref, defineComponent } from "vue";
export default defineComponent({
	setup() {

		// 表格数据
		const table = ref({
			key: 'Mass_DetectionItems_ID',
			cnName: '检测项',
			name: 'Mass_DetectionItems',
			url: "/Mass_DetectionItems/",
			sortName: "CreateDate"
		});

		// 列表
		const columns = ref([
			{ field: 'Mass_DetectionItems_ID', title: '检测项主键', type: 'int', hidden: true, readonly: true, require: true, align: 'left' },
			{ field: 'Mass_DetectionItems_Code', title: '检测项编码', type: 'string', width: 200, link: true, align: 'left' },
			{ field: 'Mass_DetectionItems_Name', title: '检测项名称', type: 'string', width: 200, sort: true, require: true, align: 'left' },
			{ field: 'Mass_DetectionItems_Type', title: '检测项类型', type: 'string', width: 120, bind: { key: 'QCDefectType', data: [] }, require: true, align: 'left' },
			{ field: 'Mass_DetectionItems_Tool', title: '检测工具', type: 'string', width: 120, require: true, align: 'left' },
			{ field: 'Mass_DetectionItems_Remark', title: '备注', type: 'string', width: 120, align: 'left' },
			{ field: 'CreateID', title: '创建人编号', type: 'int', width: 120, hidden: true, align: 'left' },
			{ field: 'Creator', title: '创建人', type: 'string', width: 120, align: 'left' },
			{ field: 'CreateDate', title: '创建时间', type: 'datetime', sort: true, width: 150, align: 'left' },
			{ field: 'ModifyID', title: '修改人编号', type: 'int', width: 120, hidden: true, align: 'left' },
			{ field: 'Modifier', title: '修改人', type: 'string', width: 120, align: 'left' },
			{ field: 'ModifyDate', title: '修改时间', type: 'datetime', sort: true, width: 150, align: 'left' }
		]);

		// 表单字段
		const editFormFields = ref({
			Mass_DetectionItems_Code: '',
			Mass_DetectionItems_Name: '',
			Mass_DetectionItems_Type: '',
			Mass_DetectionItems_Tool: '',
			Mass_DetectionItems_Remark: ''
		});

		// 表单配置
		const editFormOptions = ref([
			[{ title: "检测项编码", field: "Mass_DetectionItems_Code", type: "text", placeholder: "编码若为空，则自动生成编码", colSize: 12 }],
			[{ title: "检测项名称", required: true, field: "Mass_DetectionItems_Name", type: "text", colSize: 12 }],
			[{ dataKey: "QCDefectType", data: [], title: "检测项类型", required: true, field: "Mass_DetectionItems_Type", type: "select", colSize: 12 }],
			[{ title: "检测工具", required: true, field: "Mass_DetectionItems_Tool", type: "text", colSize: 12 }],
			[{ title: "备注", field: "Mass_DetectionItems_Remark", type: "textarea", colSize: 12 }]
		]);

		// 搜索条件
		const searchFormFields = ref(
			{
				"Mass_DetectionItems_Name": "",
				"Mass_DetectionItems_Type": "",
				"Mass_DetectionItems_Tool": "",
				"Mass_DetectionItems_Remark": ""
			}
		);

		// 高级查询条件
		const searchFormOptions = ref([
			[
				{ "title": "检测项名称", "field": "Mass_DetectionItems_Name", "type": "like" },
				{ "dataKey": "QCDefectType", "data": [], "title": "检测项类型", "field": "Mass_DetectionItems_Type", "type": "select" },
			],
			[
				{ "title": "检测工具", "field": "Mass_DetectionItems_Tool", "type": "like" },
				{ "title": "备注", "field": "Mass_DetectionItems_Remark", "type": "like" },
			]
		]);



		// 详情
		const detail = ref({
			cnName: "#detailCnName",
			table: "#detailTable",
			columns: [],
			sortName: "",
			key: ""
		});


		return {
			table,
			extend,
			editFormFields,
			editFormOptions,
			searchFormFields,
			searchFormOptions,
			columns,
			detail,
		};
	},
});
</script>
